import request from '@/utils/request'

export function list(query) {
    return request({
        url: '/user/list',
        method: 'post',
        data:query
    })
}

export function info(id) {
    return request({
        url: '/user/info/' + id,
        method: 'get'
    })
}


export function upload(file) {
    let url = '/account/upload';
    let forms = new FormData()
    forms.append("file",file)
    let config = {
        headers:{'Content-Type':'multipart/form-data'}
    }; //
    return request.post(url,forms,config)
}

export function save(data) {
    return request({
        url: '/user/save',
        method: 'post',
        data
    })
}

export function update(data) {
    return request({
        url: '/user/update',
        method: 'post',
        data
    })
}

export function remove(data) {
    return request({
        url: '/user/delete',
        method: 'post',
        data
    })
}

export function store(userId) {
    let url = '/user/store'
    let data = {userId}
    return request.post(url,data)
}


